<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button onclick="test1()">测试1-打开窗口</button>
		<button onclick="test2()">测试1-关闭</button>
		<script type="text/javascript">
			
			var p;
			function test1()
			{
				p=window.open("new1.html","new","width=200,height=100");
				
				var w = screen.width;
				var h = screen.height;
				// 移动窗口
				p.moveTo((w-200)/2,(h-100)/2);
			}
			
			function test2()
			{
				p.close();
			}
		</script>
	</body>
</html>